import { useAuth } from '@/hooks/auth-hooks';
import { Navigate, Outlet } from 'umi';

export default () => {
  const { isLogin, isSuperUser } = useAuth();
  if (isLogin===false) {
    return <Navigate to="/login" />;
  }
  if (isSuperUser===false) {
    return <Navigate to="/not-authorized" />;
  }

  return <Outlet />;
};
